package apis

import (
	"github.com/gin-gonic/gin"
	"hulk-api/models/alert"
	"net/http"
)


func AlertSetting(c *gin.Context)  {
	var a alert.MonitorAlertEntry
	c.BindJSON(&a)
	a.Setting()
	c.JSON(http.StatusOK,gin.H{
		"code": 200,
	})

}

func AlertStatus(c *gin.Context)  {
	host := c.Query("ip")
	//var a alert.MonitorAlertEntry
	alerts := alert.GetAlertStatus(host)
	c.JSON(http.StatusOK,gin.H{
		"code": 200,
		"alerts":alerts,
	})

}